package com.chap18;

import lombok.extern.slf4j.Slf4j;
import org.openjdk.jol.info.ClassLayout;

/**
 * <p>
 * <code>LockEscalationDemo</code>
 * </p>
 *
 * @author junbao3
 * TODO
 * @date 2023-05-17 16:29
 * Copyright (C) 2021 IFlyTek. All rights reserved.
 */
@Slf4j
public class LockEscalationDemo2 {
    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(5000);
        Object obj = new Object();
        log.debug(ClassLayout.parseInstance(obj).toPrintable());//匿名偏向锁 101
       synchronized (obj){
            log.debug(ClassLayout.parseInstance(obj).toPrintable());//偏向锁 101 有偏向的线程了
       }

    }
}
